package com.shop.service.impl;

import java.util.List;

import com.shop.bean.Good;
import com.shop.bean.Page;
import com.shop.dao.GoodsDao;
import com.shop.dao.impl.GoodsDaoImpl;
import com.shop.service.GoodsService;

public class GoodsServiceImpl implements GoodsService{
	GoodsDao gd=new GoodsDaoImpl();

	@Override
	public List<Good> selectGoods() {
		List<Good> goodList=gd.selectGoods();
		return goodList;
	}

	@Override
	public Page<Good> selectALLGoods(int pageNum, int pageSize) {
		List<Good> goodList=gd.selectAllGoods(pageNum, pageSize);
		int rows=gd.selectTotalNum();
		Page<Good> page=new Page(goodList,pageNum,pageSize,rows);
		return page;
	}

	@Override
	public int deleteGoodsById(int goodsId) {
		return gd.deleteGoodsById(goodsId);
	}
	
	
}
